package com.myssoteka.shared.dao;

import javax.persistence.EntityManager;

import com.myssoteka.shared.domain.Book;

public enum BookDao {
	INSTANCE;

	public void add(String title, String author, String publisher, String category) {
		synchronized (this) {
			EntityManager em = EMFService.get().createEntityManager();
			Book book = new Book(title, author, publisher, category);
			em.persist(book);
			em.close();
		}
	}

}